<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
class DmdaotaoViewLinhvucnckh extends JViewLegacy {
	
	function display($tpl = null) {
	  $task = JRequest::getVar('task');
		  switch($task){
		   case 'add':
		   case 'edit':
		    $this->getEditItem();
		    $this->setLayout('form');
		    break;
		   case 'checkTrungten':
		   	$this->checkTrungten();
		   default :
		    $this->_default();
		    break;
  }
 
  parent::display($tpl);
 }
 public function _default(){
 	$vname    = JRequest::getVar( 'view', 'linhvucnckh');
//  	$model  = Core::model('Danhmuc/RankCode');
 	$model = JModelLegacy::getInstance('Linhvucnckh','DmdaotaoModel');
 	$title='';
 	$items  = $model->findAll();
 
 	$vName = JRequest::getString('view');
//  	$uri=  JFactory::getURI();
 	$id =JRequest::getVar('colid');
 	$this->assignRef('colid', $id);
 	 
 	$this->assignRef('items', $items);
 
//  	DmdaotaoHelper::addSubmenu($vName);
//  	DmdaotaoHelper::addButton($vName);
 	$this->sidebar = JHtmlSidebar::render();
 	 
 	$title=JRequest::getVar('title');
 	$this->assignRef('title', $title);
//  	$this->assignRef('request_url', $uri->toString());
 	 
 	 
 }
 function getEditItem(){
 	$vName = JRequest::getString('view');
 	$row =JRequest::getVar('data');
 	@$text = (int)$row['id'] < 1 ? JText::_( 'Thêm mới' ) : JText::_( 'Hiệu chỉnh' );
//  	$lists['status'] = JHTML::_('select.booleanlist',  'status', 'class="inputbox"', $row['status'] );
//  	$this->assignRef('lists',        $lists);
 	JToolBarHelper::title(JText::_( 'Danh mục Lĩnh vực nghiên cứu khoa học' ).': <small><small>[ ' . $text.' ]</small></small>','generic.png' );
//  	DmdaotaoHelper::addButton($vName);
 	$this->assignRef('row', $row);
 }
}

?>